<?php /* Smarty version 2.6.18, created on 2010-03-11 10:12:42
         compiled from dataTAC.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'dataTAC.tpl', 128, false),)), $this); ?>
<div id="main_content">
<div id="blanket" style="display:none;"></div>
<div>
	<h1>Tac Maintenance</h1>
</div>
<table class="blue" width="100%">
	<tr valign="top" width="100%">
		<td width="99%" align="left">
			<div id="search">
				<form name="searchForm" id="searchForm" method="POST">
					<h3><b>Searching<b></h3>
					<table width="100%" >
						<tr>
							<td width="15%"><label>Country:</label></td>
							<td>
								<div id="country">
								<select id="country" name="country" onchange="doajaxAction('/admin/dataOMProvince/country/'+document.searchForm.country.value,0,'province');">
									<option value=""> --- </option>
									<?php $_from = $this->_tpl_vars['countries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['country']):
?>
									<option value="<?php echo $this->_tpl_vars['country']['country_code']; ?>
"><?php echo $this->_tpl_vars['country']['country']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
								</div>
							</td>
						</tr>
						<tr>
							<td><label>Province:</label></td>
							<td>
								<div id="province">
								<select name="province">
									<option value=""> --- </option>
								</select>
								</div>
							</td>
						</tr>
						<tr>
							<td><label>FMA:</label></td>
							<td>
								<div id="fma">
								<select name="fma">
									<option value=""> --- </option>
								</select>
								</div>
							</td>
						</tr>
						<tr>
							<td><label>Organism Group:</label></td>
							<td>
								<select name="group">
									<option value=""> --- </option>
									<?php $_from = $this->_tpl_vars['groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['group']):
?>
									<option value="<?php echo $this->_tpl_vars['group']['organism_group_id']; ?>
">
										<?php echo $this->_tpl_vars['group']['organism_group']; ?>

									</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td><label>Name:</label></td>
							<td>
								<input type="text" name="names">
							</td>
							<td align="right">
								<input type="button" value="Go" onclick="search_organism();">
							</td>
						</tr>
					</table>
				</form>
			</div>
			<br><br>
		</td>
		<td>
			<a onclick="toggle_div('search');" href="javascript:void(0);">
				<img id="show_arrow" border="0" src="/app/default/www/images/arrow-down.png" alt="Show Search"/>
			</a>
		</td>
	</tr>
	<tr valign="top" width="100%">
		<td width="99%" align="left">
			<div id="upload" style="display:none;">
				<form method="POST" action="/admin/dataTMImport" enctype="multipart/form-data">
					<h3><b>Batch Upload:</b></h3>
					<table width="100%">
						<tr>
							<td width="15%"><label>Click here to export spreadsheet:</label></td>
							<td><input type="button" onclick="export_excel();" value="Export"></td>
						</tr>
						<tr>
							<td>
								<input type="file" name="file" id="file" />
							</td>
							<td>
								<input type="submit" value="Upload">
							</td>
						</tr>
					</table>
					<br>
				</form>
			</div>
		</td>
		<td>
			<a onclick="toggle_div('upload');" href="javascript:void(0);">
				<img id="show_arrow" border="0" src="/app/default/www/images/arrow-down.png" alt="Show Search"/>
			</a>
		</td>
	</tr>
</table>
<br><br>
<form method="POST" action="/admin/dataTMSaveListChanges">
<div id="data_table">
<!--table width="100%">
	<tr bgcolor="#cccccc">
		<td width="5%"></td>
		<td width="5%"></td>
		<td width="5%"><label><b>Mac Certified</b></td>
		<td width="5%"><label><b>Unsuitable Species</b></td>
		<td><label><b>Organism Name</b></label></td>
		<td><label><b>Fishing Area</b></label></td>
		<td><label><b>Limit Quantity</b></label></td>
		<td><label><b>Date Start-Date Expire</b></label></td>
		<td><label><b>Group</b></label></td>
		<td><label><b>FMA</b></label></td>
		<td><label><b>Province</b></label></td>
		<td><label><b>Country</b></label></td>
	</tr>
	<?php $_from = $this->_tpl_vars['results']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['result']):
?>
		<tr class="<?php echo smarty_function_cycle(array('values' => "blue,notify"), $this);?>
">
			<td width="5%" align="center">
				<input type="button" value="Edit" onclick="doajaxAction('/admin/dataTACEdit/id/<?php echo $this->_tpl_vars['result']['tac_id']; ?>
',0,'edit_content');popup('popUpDiv');">
			</td>
			<td width="5%" align="center">
				<input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['result']['tac_id']; ?>
">
			</td>
			<td width="5%" align="center"><input type="checkbox" <?php if ($this->_tpl_vars['result']['mac_certified']): ?>checked<?php endif; ?> DISABLED></td>
			<td width="5%" align="center"><input type="checkbox" <?php if ($this->_tpl_vars['result']['unsuitable_species']): ?>checked<?php endif; ?> DISABLED></td>
			<td>
				<div align="center">
				<?php if ($this->_tpl_vars['result']['link']): ?><img src="<?php echo $this->_tpl_vars['result']['link']; ?>
" height="50px" width="50px"><br><?php endif; ?>
				<label><?php echo $this->_tpl_vars['result']['name']; ?>
</label>
				</div>
			</td>
			<td><label><?php echo $this->_tpl_vars['result']['fishing_area_name']; ?>
</label></td>
			<td><label><?php echo $this->_tpl_vars['result']['limit_quantity']; ?>
</label></td>
			<td><label><?php echo $this->_tpl_vars['result']['date_start']; ?>
 - <?php echo $this->_tpl_vars['result']['date_expire']; ?>
</label></td>
			<td><label><?php echo $this->_tpl_vars['result']['organism_group']; ?>
</label></td>
			<td><label><?php echo $this->_tpl_vars['result']['trading_name']; ?>
</label></td>
			<td><label><?php echo $this->_tpl_vars['result']['province']; ?>
</label></td>
			<td><label><?php echo $this->_tpl_vars['result']['country']; ?>
</label></td>
		</tr>
	<?php endforeach; endif; unset($_from); ?>
</table-->
</div>
<br><hr>
<input type="button" value="Add" 
					onclick="doajaxAction('/admin/dataTACEdit/id/0',0,'edit_content');popup('popUpDiv');">
<input type="submit" value="Save Changes">
</form>
<div id="popUpDiv" style="position:absolute;display:none;z-index:1002;">
	<table class="popup" border="0" cellspacing=0 cellpadding=0>
		<tr>
			<td>
				<div class="pop">
					<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
					<div id="edit_content" class="content">
					</div>
					<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" /></div>
				</div>
			</td>
		</tr>
	</table> 
</div>
</div>

<?php echo '
<script language="javascript">
	function edit_item(id){
		doajaxAction(\'/admin/dataOMEdit/id/\'+id,0,\'edit_content\');
	}
	
	function search_organism(){
		var params=\'/fma/\'+document.searchForm.fma.value+
				   \'/group/\'+document.searchForm.group.value+				   \'/country/\'+document.searchForm.country.value+
				   \'/names/\'+document.searchForm.names.value;
		doajaxAction(\'/admin/dataTMSearch\'+params,0,\'data_table\');
	}
	
	function export_excel(){
		window.location="/admin/dataTMExport";
	}
</script>
'; ?>



	
	
	